﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;

namespace VueShopApi.Entities 
{
	/// <summary>
	/// 属性表
	/// </summary>
	[JsonObject(MemberSerialization.OptIn), Table(Name = "sp_attribute", DisableSyncStructure = true)]
	public partial class SpAttribute 
	{
		/// <summary>
		/// 主键id
		/// </summary>
		[JsonProperty("attr_id"), Column(Name = "attr_id", IsPrimary = true, IsIdentity = true)]
		public int AttrId { get; set; }

		/// <summary>
		/// 属性名称
		/// </summary>
		[JsonProperty("attr_name"), Column(Name = "attr_name", StringLength = 32, IsNullable = false)]
		public string AttrName { get; set; }

		/// <summary>
		/// only:输入框(唯一)  many:后台下拉列表/前台单选框
		/// </summary>
		[JsonProperty("attr_sel"), Column(Name = "attr_sel", InsertValueSql = "'only'")]
		public string AttrSel { get; set; }

		/// <summary>
		/// 可选值列表信息,例如颜色：白色,红色,绿色,多个可选值通过逗号分隔
		/// </summary>
		[JsonProperty("attr_vals"), Column(Name = "attr_vals", StringLength = -1, IsNullable = false)]
		public string AttrVals { get; set; }

		/// <summary>
		/// manual:手工录入  list:从列表选择
		/// </summary>
		[JsonProperty("attr_write"), Column(Name = "attr_write", InsertValueSql = "'manual'")]
		public string AttrWrite { get; set; }

		/// <summary>
		/// 外键，类型id
		/// </summary>
		[JsonProperty("cat_id"), Column(Name = "cat_id")]
		public int CatId { get; set; }

		/// <summary>
		/// 删除时间标志
		/// </summary>
		[JsonProperty("delete_time"), Column(Name = "delete_time")]
		public int? DeleteTime { get; set; }

	}

	public enum SpAttributeATTRSEL {
		only = 1, many
	}
	public enum SpAttributeATTRWRITE {
		manual = 1, list
	}
}
